package ru.ifmo.thesis.task;

import java.util.List;

import ru.ifmo.thesis.domain.Job;
import ru.ifmo.thesis.domain.Worker;

public class DOPTask {
	private final List<Worker> workers;
	
	private final List<Job> initialJobs;

	private final List<Job> additionalJobs;

	public DOPTask(List<Worker> workers, List<Job> initialJobs,
			List<Job> additionalJobs) {
		super();
		this.workers = workers;
		this.initialJobs = initialJobs;
		this.additionalJobs = additionalJobs;
	}

	public List<Worker> getWorkers() {
		return workers;
	}

	public List<Job> getInitialJobs() {
		return initialJobs;
	}

	public List<Job> getAdditionalJobs() {
		return additionalJobs;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((additionalJobs == null) ? 0 : additionalJobs.hashCode());
		result = prime * result
				+ ((initialJobs == null) ? 0 : initialJobs.hashCode());
		result = prime * result + ((workers == null) ? 0 : workers.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DOPTask other = (DOPTask) obj;
		if (additionalJobs == null) {
			if (other.additionalJobs != null)
				return false;
		} else if (!additionalJobs.equals(other.additionalJobs))
			return false;
		if (initialJobs == null) {
			if (other.initialJobs != null)
				return false;
		} else if (!initialJobs.equals(other.initialJobs))
			return false;
		if (workers == null) {
			if (other.workers != null)
				return false;
		} else if (!workers.equals(other.workers))
			return false;
		return true;
	}
	
	
}
